<?php

/**
 * Este es la clase modelo de la tabla "alumno_familiar".
 *
 * Los siguientes campos estan disponibles en la tabla 'alumno_familiar':
 * @property integer $alumno_idalumno
 * @property integer $familiar_idfamiliar
 */
class AlumnoFamiliar extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return AlumnoFamiliar the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'alumno_familiar';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('alumno_idalumno, familiar_idfamiliar', 'required'),
			array('alumno_idalumno, familiar_idfamiliar', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('alumno_idalumno, familiar_idfamiliar', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'alumno_idalumno' => 'Alumno Idalumno',
			'familiar_idfamiliar' => 'Familiar Idfamiliar',
		);
	}

	/**
	 * Devuelve una lista de modelos basado en la b�squeda o filtro acutal.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('alumno_idalumno',$this->alumno_idalumno);
		$criteria->compare('familiar_idfamiliar',$this->familiar_idfamiliar);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
	
	public function primaryKey()
	{
		return array('alumno_idalumno', 'familiar_idfamiliar');
	}
	
}